﻿Imports System.Windows.Forms

Public Class SaveDevice
    Private M_Dev As String
    Private M_Menu As String
    Private M_Name As String

    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.OK
        Me.Close()
    End Sub
    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.Close()
    End Sub
    Public Sub AddDevice(ByVal Name As String)
        ComboBox1.Items.Add(Name)
    End Sub
    Public Sub AddMenu(ByVal Menu As String)
        ComboBox2.Items.Add(Menu)
    End Sub

    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
        M_Dev = ComboBox1.SelectedItem
    End Sub

    Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
        M_Menu = ComboBox2.SelectedItem
    End Sub
    Public Property SelectedDevice() As String
        Get
            Return M_Dev
        End Get
        Set(ByVal value As String)
            M_Dev = value
        End Set
    End Property
    Public Property SelectedMenu() As String
        Get
            Return M_Menu
        End Get
        Set(ByVal value As String)
            M_Menu = value
        End Set
    End Property
    Public Property DeviceName() As String
        Get
            Return TextBox1.Text
        End Get
        Set(ByVal value As String)
            TextBox1.Text = value
        End Set
    End Property
End Class
